targetted_decisions = {
	summon_cleric_to_court = {
		
		ai_target_filter = self #the ai won't use this anyway
		filter = all
		only_rulers = yes
		
		from_potential = {		
			ai = no
			government = religious_head
			#NOT = { cardinal_icon = { count = 9 } }
		}
		
		potential = {
			is_ruler = yes
			is_theocracy = yes
			NOT = { trait = cardinal_icon }
		}
		
		allow = {
			rightful_religious_head = FROM
		}
		
		effect = {
			hidden_tooltip = {
				liege = { save_event_target_as = cardinals_liege}
				create_character = {
					random_traits = no
					culture = ROOT
					religion = ROOT
					age = 16 #Prevent issues with them being a child, namely need for a tutor
					name = " "
					employer = FROM
					attributes = {
						martial = 6
						intrigue = 6
						diplomacy = 6
						stewardship = 6
						learning = 6				
					}
				}
				
				new_character = { #we make a placeholder character as before
					#inherit = ROOT #but instead we give him the titles of the would-be cardinal
					save_event_target_as = sede_vacante #and save him as a later scope
				}
				abdicate_to = event_target:sede_vacante #but instead we give him the titles of the would-be cardinal
				move_character = FROM #We move the future cardinal to the pope's court
				set_government_type = theocracy_government
				character_event = { id = cardinal_summoning.0 }#and give you an event so that you can click on the character portrait, name him cardinal and send him back.
				#actually, cardinal_summoning.0 is a hidden event to get the scopes right, because for some reason both inherit and abdicate_to makes the game think that the new_character will be the FROM of the event.
			}
		}
		
		revoke_allowed = {
			always = no
		}
		
		ai_will_do = {
			factor = 0
		}
	}
}